
Partial Class Admin_frmEmployeeDetail
    Inherits System.Web.UI.Page
    Dim VarEmpId As String
    Dim _EmployeeVO As New EmployeeVo
    Dim _BO As New Bo
    Dim _EmployeeId As String
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        _EmployeeId = Session("EmpId")
        If _EmployeeId = "" Then
            Response.Redirect("../Client/frmLogin.aspx")
        End If
        VarEmpId = Request.QueryString("EmployeeId")
        If VarEmpId = "" Then
            Response.Redirect("")
        Else
            If Not IsPostBack Then
                GetEmployeeData()

            End If
        End If
    End Sub
    Sub GetEmployeeData()
        _EmployeeVO = _BO.getEmployeeById(VarEmpId)
        lblEmployeeId.Text = _EmployeeVO.EmployeeId
        txtPassword.Text = _EmployeeVO.Password
        txtFirstName.Text = _EmployeeVO.FirstName
        txtLastName.Text = _EmployeeVO.LastName
        txtAddress.Text = _EmployeeVO.Address
        txtPhoneNumber.Text = _EmployeeVO.PhoneNumber
        txtEmailId.Text = _EmployeeVO.EmailId
        txtDesignation.Text = _EmployeeVO.Designation
    End Sub

    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
        Session("EmpId") = _EmployeeId
        SetData()
    End Sub
    Sub SetData()
        _EmployeeVO.EmployeeId = lblEmployeeId.Text
        _EmployeeVO.Password = txtPassword.Text
        _EmployeeVO.FirstName = txtFirstName.Text
        _EmployeeVO.LastName = txtLastName.Text
        _EmployeeVO.Address = txtAddress.Text
        _EmployeeVO.PhoneNumber = txtPhoneNumber.Text
        _EmployeeVO.EmailId = txtEmailId.Text
        _EmployeeVO.Designation = txtDesignation.Text
        _BO.ModifyEmployee(_EmployeeVO)

        ClearAll()
    End Sub
    Public Sub ClearAll()
        txtPassword.Text = ""
        txtFirstName.Text = ""
        txtLastName.Text = ""
        txtAddress.Text = ""
        txtPhoneNumber.Text = ""
        txtEmailId.Text = ""
        txtDesignation.Text = ""
        MsgBox("Employee Modified")
        Response.Redirect("frmTabEmployee.aspx", False)
    End Sub

    Protected Sub btnReset_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReset.Click
        txtPassword.Text = ""
        txtFirstName.Text = ""
        txtLastName.Text = ""
        txtAddress.Text = ""
        txtPhoneNumber.Text = ""
        txtEmailId.Text = ""
        txtDesignation.Text = ""
    End Sub
End Class
